package speed2010.util;

import speed2010.middleware.comunicacao.Address;

public class ParAddress {
	private Address addressNode1 = null;
	private Address addressNode2 = null;

	public ParAddress(Address addressNode1, Address addressNode2) {
		this.addressNode1 = addressNode1;
		this.addressNode2 = addressNode2;
	}

	@Override
	public boolean equals(Object obj) {
		if (this.getAddressNode1().equals(((ParAddress) obj).getAddressNode1())
				&& this.getAddressNode2().equals(((ParAddress) obj).getAddressNode2())) {
			return true;
		} else {
			return false;
		}
	}

	public Address getAddressNode1() {
		return addressNode1;
	}

	public Address getAddressNode2() {
		return addressNode2;
	}

	public void setAddressNode2(Address addressNode2) {
		this.addressNode2 = addressNode2;
	}

	public void setAddressNode1(Address addressNode1) {
		this.addressNode1 = addressNode1;
	}

	@Override
	public String toString() {
		return this.getAddressNode1().toStringReduzido() + " ; "
				+ this.getAddressNode2().toStringReduzido();
	}
}
